package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.TravelContent;
import cn.wolfcode.luowowo.article.mapper.TravelContentMapper;
import cn.wolfcode.luowowo.article.service.ITravelContentService;
import cn.wolfcode.luowowo.common.query.QueryObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class TravelContentServiceImpl implements ITravelContentService {

    @Autowired
    private TravelContentMapper travelContentMapper;

    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<TravelContent> list = travelContentMapper.selectForList(qo);
        return new PageInfo(list);
    }

    public TravelContent getTravelContent(Long id) {
        return travelContentMapper.selectByPrimaryKey(id);
    }
}
